gmx -quiet editconf -f complex.pdb -o CB0-BCD_1.gro -box 5.27 5.27 5.27
gmx -quiet solvate -cp CB0-BCD_1.gro -o CB0-BCD_1.gro -p CB0-BCD_1.top
gmx -quiet grompp -f em.mdp -po CB0-BCD_1_em.mdp -c CB0-BCD_1.gro -p CB0-BCD_1.top -o CB0-BCD_1_em.tpr -maxwarn 1
gmx -quiet mdrun -deffnm CB0-BCD_1_em
echo q | gmx -quiet make_ndx -f CB0-BCD_1.gro -o CB0-BCD_1_index.ndx
gmx -quiet grompp -f nvt.mdp -po CB0-BCD_1_nvt.mdp -c CB0-BCD_1_em.gro -r CB0-BCD_1_em.gro -p CB0-BCD_1.top -o CB0-BCD_1_nvt.tpr -n CB0-BCD_1_index.ndx
gmx -quiet mdrun -deffnm CB0-BCD_1_nvt
gmx -quiet grompp -f npt.mdp -po CB0-BCD_1_npt.mdp -c CB0-BCD_1_nvt.gro -t CB0-BCD_1_nvt.cpt -r CB0-BCD_1_nvt.gro -p CB0-BCD_1.top -o CB0-BCD_1_npt.tpr -n CB0-BCD_1_index.ndx
gmx -quiet mdrun -deffnm CB0-BCD_1_npt
gmx -quiet grompp -f md.mdp -po CB0-BCD_1_md.mdp -c CB0-BCD_1_npt.gro -t CB0-BCD_1_npt.cpt -p CB0-BCD_1.top -o CB0-BCD_1_md.tpr -n CB0-BCD_1_index.ndx

gmx -quiet mdrun -deffnm CB0-BCD_1_md
for n in $(seq 2 10)
do
gmx -quiet convert-tpr -s CB0-BCD_1_md.tpr -extend 10000 -o CB0-BCD_1_md.tpr
gmx -quiet mdrun -deffnm CB0-BCD_1_md -cpi CB0-BCD_1_md.cpt
done

echo -e "2\n 1\n" | gmx -quiet trjconv -s CB0-BCD_1_md.tpr -f CB0-BCD_1_md.xtc -o CB0-BCD_1_md_c.xtc -center -pbc mol -n CB0-BCD_1_index.ndx -ur compact
echo -e "2\n 1\n" | gmx -quiet trjconv -s CB0-BCD_1_md.tpr -f CB0-BCD_1_md_c.xtc -o CB0-BCD_1_md_fit.xtc -n CB0-BCD_1_index.ndx -fit rot+trans
echo -e "2\n 1\n" | gmx -quiet trjconv -s CB0-BCD_1_md.tpr -f CB0-BCD_1_md.gro -o CB0-BCD_1_md_f.gro -center -pbc mol -n CB0-BCD_1_index.ndx -ur compact
echo -e "1\n 1\n" | gmx -quiet rms -s CB0-BCD_1_md.tpr -f CB0-BCD_1_md_fit.xtc -n CB0-BCD_1_index.ndx -o rmsd.xvg -m rmsd.xpm
echo -e "1\n 1\n" | gmx -quiet cluster -s CB0-BCD_1_md.tpr -f CB0-BCD_1_md_fit.xtc -n CB0-BCD_1_index.ndx -dm rmsd.xpm -om rmsd-raw.xpm -o rmsd-clust.xpm -g cluster.log -clid clusters.xvg -cl clusters.pdb -cutoff 0.1
echo -e "2\n 3\n" | gmx -quiet hbond -s CB0-BCD_1_md.tpr -f CB0-BCD_1_md_fit.xtc -n CB0-BCD_1_index.ndx -num hbnum.xvg -hbm hbmap.xpm -hbn hbond.ndx
gmx_MMPBSA -nogui -i mmpbsa.in -cs CB0-BCD_1_md.tpr -ci CB0-BCD_1_index.ndx -cg 2 3 -ct CB0-BCD_1_md_fit.xtc -cp CB0-BCD_1.top -o CB0-BCD_1_GBSA.dat -eo CB0-BCD_1_GBSA.csv